<?php
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");

include("include/dbcommon.php");
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); 

include("include/admin_rights_variables.php");


$gsqlHead="select `user_name` ";
$gsqlFrom="from `users`";
$gsqlWhereExpr="";
$gsqlTail="";
// $gstrSQL = "SELECT TableName,   GroupID,   AccessMask  FROM expodoc_ugrights ";
$gstrSQL = gSQLWhere("");


if(!@$_SESSION["UserID"])
{ 
	$_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];
	header("Location: login.php?message=expired"); 
	return;
}
if(!IsAdmin())
{
	echo "<p>".mlang_message("NO_PERMISSIONS")." <a href=\"login.php\">".mlang_message("BACK_TO_LOGIN")."</a></p>";
	return;
}

include('include/xtempl.php');
include('classes/runnerpage.php');
include('classes/listpage.php');
include('classes/rightspage.php');
$xt = new Xtempl();



$options = array();
//array of params for classes
$options["pageType"] = PAGE_LIST;
$options["id"] = postvalue("id") ? postvalue("id") : 1;
$options["mode"] = RIGHTS_PAGE;
$options['xt'] = &$xt;
$nonAdminTablesRightsArr=array();
$nonAdminTablesArr=array();
$nonAdminTablesArr[] = array("certificate_of_origin_commercials",GetTableCaption("certificate_of_origin_commercials"));
$nonAdminTablesRightsArr["certificate_of_origin_commercials"]=array();
$nonAdminTablesArr[] = array("certificate_of_origin_items",GetTableCaption("certificate_of_origin_items"));
$nonAdminTablesRightsArr["certificate_of_origin_items"]=array();
$nonAdminTablesArr[] = array("cities",GetTableCaption("cities"));
$nonAdminTablesRightsArr["cities"]=array();
$nonAdminTablesArr[] = array("commercial_invoice_items",GetTableCaption("commercial_invoice_items"));
$nonAdminTablesRightsArr["commercial_invoice_items"]=array();
$nonAdminTablesArr[] = array("commercial_invoices",GetTableCaption("commercial_invoices"));
$nonAdminTablesRightsArr["commercial_invoices"]=array();
$nonAdminTablesArr[] = array("companies",GetTableCaption("companies"));
$nonAdminTablesRightsArr["companies"]=array();
$nonAdminTablesArr[] = array("countries",GetTableCaption("countries"));
$nonAdminTablesRightsArr["countries"]=array();
$nonAdminTablesArr[] = array("currencies",GetTableCaption("currencies"));
$nonAdminTablesRightsArr["currencies"]=array();
$nonAdminTablesArr[] = array("gsp_commercial_details",GetTableCaption("gsp_commercial_details"));
$nonAdminTablesRightsArr["gsp_commercial_details"]=array();
$nonAdminTablesArr[] = array("gsp_item_details",GetTableCaption("gsp_item_details"));
$nonAdminTablesRightsArr["gsp_item_details"]=array();
$nonAdminTablesArr[] = array("modules",GetTableCaption("modules"));
$nonAdminTablesRightsArr["modules"]=array();
$nonAdminTablesArr[] = array("pack_uoms",GetTableCaption("pack_uoms"));
$nonAdminTablesRightsArr["pack_uoms"]=array();
$nonAdminTablesArr[] = array("packing_list_items",GetTableCaption("packing_list_items"));
$nonAdminTablesRightsArr["packing_list_items"]=array();
$nonAdminTablesArr[] = array("packing_lists",GetTableCaption("packing_lists"));
$nonAdminTablesRightsArr["packing_lists"]=array();
$nonAdminTablesArr[] = array("payment_terms",GetTableCaption("payment_terms"));
$nonAdminTablesRightsArr["payment_terms"]=array();
$nonAdminTablesArr[] = array("perferences",GetTableCaption("perferences"));
$nonAdminTablesRightsArr["perferences"]=array();
$nonAdminTablesArr[] = array("permissions",GetTableCaption("permissions"));
$nonAdminTablesRightsArr["permissions"]=array();
$nonAdminTablesArr[] = array("ports",GetTableCaption("ports"));
$nonAdminTablesRightsArr["ports"]=array();
$nonAdminTablesArr[] = array("proforma_invoice_items",GetTableCaption("proforma_invoice_items"));
$nonAdminTablesRightsArr["proforma_invoice_items"]=array();
$nonAdminTablesArr[] = array("proforma_invoices",GetTableCaption("proforma_invoices"));
$nonAdminTablesRightsArr["proforma_invoices"]=array();
$nonAdminTablesArr[] = array("roles",GetTableCaption("roles"));
$nonAdminTablesRightsArr["roles"]=array();
$nonAdminTablesArr[] = array("shipment_modes",GetTableCaption("shipment_modes"));
$nonAdminTablesRightsArr["shipment_modes"]=array();
$nonAdminTablesArr[] = array("states",GetTableCaption("states"));
$nonAdminTablesRightsArr["states"]=array();
$nonAdminTablesArr[] = array("uoms",GetTableCaption("uoms"));
$nonAdminTablesRightsArr["uoms"]=array();
$nonAdminTablesArr[] = array("user_pereferences",GetTableCaption("user_pereferences"));
$nonAdminTablesRightsArr["user_pereferences"]=array();
$nonAdminTablesArr[] = array("users",GetTableCaption("users"));
$nonAdminTablesRightsArr["users"]=array();
$nonAdminTablesArr[] = array("brcs",GetTableCaption("brcs"));
$nonAdminTablesRightsArr["brcs"]=array();
$nonAdminTablesArr[] = array("brc_items",GetTableCaption("brc_items"));
$nonAdminTablesRightsArr["brc_items"]=array();
$nonAdminTablesArr[] = array("proforma_invoices_chart",GetTableCaption("proforma_invoices_chart"));
$nonAdminTablesRightsArr["proforma_invoices_chart"]=array();
$nonAdminTablesArr[] = array("proforma_invoices_report",GetTableCaption("proforma_invoices_report"));
$nonAdminTablesRightsArr["proforma_invoices_report"]=array();
$nonAdminTablesArr[] = array("packing_lists_report",GetTableCaption("packing_lists_report"));
$nonAdminTablesRightsArr["packing_lists_report"]=array();
$nonAdminTablesArr[] = array("commercial_invoices_eport",GetTableCaption("commercial_invoices_eport"));
$nonAdminTablesRightsArr["commercial_invoices_eport"]=array();
$nonAdminTablesArr[] = array("brcs_report",GetTableCaption("brcs_report"));
$nonAdminTablesRightsArr["brcs_report"]=array();
$nonAdminTablesArr[] = array("certificate_of_origin_commercials_report",GetTableCaption("certificate_of_origin_commercials_report"));
$nonAdminTablesRightsArr["certificate_of_origin_commercials_report"]=array();
$nonAdminTablesArr[] = array("gsp_commercial_details_report",GetTableCaption("gsp_commercial_details_report"));
$nonAdminTablesRightsArr["gsp_commercial_details_report"]=array();
$nonAdminTablesArr[] = array("brcs_chart",GetTableCaption("brcs_chart"));
$nonAdminTablesRightsArr["brcs_chart"]=array();
$nonAdminTablesArr[] = array("certificate_of_origin_commercials_chart",GetTableCaption("certificate_of_origin_commercials_chart"));
$nonAdminTablesRightsArr["certificate_of_origin_commercials_chart"]=array();
$nonAdminTablesArr[] = array("commercial_invoices Chart",GetTableCaption("commercial_invoices_Chart"));
$nonAdminTablesRightsArr["commercial_invoices Chart"]=array();
$nonAdminTablesArr[] = array("gsp_commercial_details Chart",GetTableCaption("gsp_commercial_details_Chart"));
$nonAdminTablesRightsArr["gsp_commercial_details Chart"]=array();
$nonAdminTablesArr[] = array("packing_lists Chart",GetTableCaption("packing_lists_Chart"));
$nonAdminTablesRightsArr["packing_lists Chart"]=array();
$nonAdminTablesArr[] = array("company_addresses",GetTableCaption("company_addresses"));
$nonAdminTablesRightsArr["company_addresses"]=array();
$nonAdminTablesArr[] = array("expodoc_uggroups",GetTableCaption("expodoc_uggroups"));
$nonAdminTablesRightsArr["expodoc_uggroups"]=array();
$nonAdminTablesArr[] = array("expodoc_ugmembers",GetTableCaption("expodoc_ugmembers"));
$nonAdminTablesRightsArr["expodoc_ugmembers"]=array();
$nonAdminTablesArr[] = array("sales_order_items",GetTableCaption("sales_order_items"));
$nonAdminTablesRightsArr["sales_order_items"]=array();
$nonAdminTablesArr[] = array("sales_orders",GetTableCaption("sales_orders"));
$nonAdminTablesRightsArr["sales_orders"]=array();
$nonAdminTablesArr[] = array("size_systems",GetTableCaption("size_systems"));
$nonAdminTablesRightsArr["size_systems"]=array();
$nonAdminTablesArr[] = array("products",GetTableCaption("products"));
$nonAdminTablesRightsArr["products"]=array();
$nonAdminTablesArr[] = array("product_descriptions",GetTableCaption("product_descriptions"));
$nonAdminTablesRightsArr["product_descriptions"]=array();
$nonAdminTablesArr[] = array("master2_properties",GetTableCaption("master2_properties"));
$nonAdminTablesRightsArr["master2_properties"]=array();
$nonAdminTablesArr[] = array("master1_properties",GetTableCaption("master1_properties"));
$nonAdminTablesRightsArr["master1_properties"]=array();
$nonAdminTablesArr[] = array("colors",GetTableCaption("colors"));
$nonAdminTablesRightsArr["colors"]=array();
$nonAdminTablesArr[] = array("styles",GetTableCaption("styles"));
$nonAdminTablesRightsArr["styles"]=array();
$nonAdminTablesArr[] = array("master_properites",GetTableCaption("master_properites"));
$nonAdminTablesRightsArr["master_properites"]=array();
$nonAdminTablesArr[] = array("size_breakup",GetTableCaption("size_breakup"));
$nonAdminTablesRightsArr["size_breakup"]=array();
$nonAdminTablesArr[] = array("sales_order_size_breakup",GetTableCaption("sales_order_size_breakup"));
$nonAdminTablesRightsArr["sales_order_size_breakup"]=array();

$options["nonAdminTablesArr"] = $nonAdminTablesArr;
$options["nonAdminTablesRightsArr"] = $nonAdminTablesRightsArr;


$pageObject = ListPage::createListPage($strTableName, $options);
 // add button events if exist

// prepare code for build page
$pageObject->prepareForBuildPage();

// show page depends of mode
$pageObject->showPage();
	//$xt->assign_loopsection("grid_row",$rowinfo);
	


?>
